package cn.melonlib.record.oper.model.entity;

import cn.melonlib.cores.commons.model.anno.MelonEntityId;
import cn.melonlib.cores.commons.model.enums.IdType;
import cn.melonlib.cores.commons.model.enums.IdValueType;
import cn.melonlib.cores.commons.model.support.number_id.MelonLibLongTenantRecordEntity;
import cn.melonlib.cores.model.anno.ModelComment;
import cn.melonlib.record.oper.model.enums.RecordType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Type;

import javax.persistence.*;

@Data
@EqualsAndHashCode(callSuper = true)
@Entity(name = "OperationRecordIndex")
@Table(name = "log_operation_record")
@ModelComment("操作日志")
@MelonEntityId(type = IdType.SNOW_FLAKE,IdValueType = IdValueType.LONG)
public class OperationRecordIndex extends MelonLibLongTenantRecordEntity {

    @ModelComment("模块或者方法或者函数")
    @Column(length = 1000)
    private String method;

    @ModelComment("开始执行时间")
    private Long startTime;

    @ModelComment("执行结束时间")
    private Long endTime;

    @ModelComment("耗费时间")
    private Long consuming;

    @Enumerated(EnumType.STRING)
    @ModelComment("记录类型")
    private RecordType recordType=RecordType.INFO;
}
